<?php
/**
 * Created by PhpStorm.
 * User: wliu
 * Date: 14-3-19
 * Time: 下午6:19
 */

class GoodsComment extends EMongoDocument {
    //买家
    public $userid;
    //评论时间
    public $createtime;
    //星级
    public $grade;
    //品论内容
    public $content;
    //商品
    public $goods;

    public $local='zn';

    /**
     * This method have to be defined in every Model
     * @return string MongoDB collection name, witch will be used to store documents of this model
     */
    public function getCollectionName()
{
    return 'goods_comment';
}

    // We can define rules for fields, just like in normal CModel/CActiveRecord classes
    public function rules()
{
    return array(

    );
}

    // the same with attribute names
    public function attributeNames() {
    return array(
        //'ad' => 'ad',
        'userid'=>'userid',
        'createtime'=>'createtime',
        'grade'=>'grade',
        'content'=>'content',
        'local'=>'local',
        'goods'=>'goods',
        '_id'=>'_id',
    );
}

    /**
     * This method have to be defined in every model, like with normal CActiveRecord
     */
    public static function model($className=__CLASS__)
{
    return parent::model($className);
}
}